Skip to content

fix: add .js extensions to .d.ts imports for node16 resolution#1083

Merged
robertsLando merged 1 commit intomainfrom
fix/node16-module-resolution
Mar 27, 2026
Merged

fix: add .js extensions to .d.ts imports for node16 resolution#1083
robertsLando merged 1 commit intomainfrom
fix/node16-module-resolution

Conversation

@robertsLando
Copy link
Copy Markdown
Member

Summary

  • Adds .js extensions to all relative imports in .d.ts type definition files
  • Fixes TypeScript moduleResolution: "node16" failing to resolve types when importing aedes

Closes #1082

Details

With moduleResolution: "node16" and "type": "module", TypeScript strictly requires file extensions on relative imports. PR #1081 added the types condition to package.json exports, allowing TypeScript to find the entry aedes.d.ts, but the internal relative imports within the .d.ts files still lacked .js extensions, causing resolution failures.

Files changed:

  • aedes.d.ts — entry point re-exports
  • types/client.d.ts — imports from packet and instance
  • types/instance.d.ts — imports from client and packet
  • types/packet.d.ts — imports from client
  • test/types/aedes.test-d.ts — test import from types/packet

Test plan

  • npm run test:typescript (tsd) passes

🤖 Generated with Claude Code

… resolution

Closes #1082

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
@codecov
Copy link
Copy Markdown

codecov Bot commented Mar 26, 2026

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 99.47%. Comparing base (806615e) to head (1de4554).
⚠️ Report is 1 commits behind head on main.

Additional details and impacted files
@@           Coverage Diff           @@
##             main    #1083   +/-   ##
=======================================
  Coverage   99.47%   99.47%           
=======================================
  Files          15       15           
  Lines        1921     1921           
=======================================
  Hits         1911     1911           
  Misses         10       10           
Flag Coverage Δ
unittests 99.47% <ø> (ø)

Flags with carried forward coverage won't be shown. Click here to find out more.

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

@robertsLando robertsLando merged commit fc36475 into main Mar 27, 2026
27 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[bug] cannot import Aedes when using TypeScript moduleResolution set to "node16"

1 participant